home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / gnumake / gnumake.zoo / diffs next >
Encoding:
Text File  |  1990-02-16  |  21.2 KB  |  882 lines

  1. *** make-3.58/orig/arscan.c    Fri Oct 20 01:46:34 1989
  2. --- make-3.58/arscan.c    Fri Feb 16 21:15:10 1990
  3. ***************
  4. *** 24,30 ****
  5. --- 24,34 ----
  6.   #define PORTAR 1
  7.   #endif
  8.   
  9. + #ifdef GEMDOS
  10. + #include <gnu-ar.h>
  11. + #else
  12.   #include <ar.h>
  13. + #endif
  14.   #include <stdio.h>
  15.   #include <sys/types.h>
  16.   #include <sys/stat.h>
  17. ***************
  18. *** 266,271 ****
  19. --- 270,279 ----
  20.     if (!pos)
  21.       return 1;
  22.   
  23. + #ifdef GEMDOS
  24. +   if (utime(arname, 0L) < 0)    /* GEMDOS needs this to touch the file */
  25. +     return -3;
  26. + #endif
  27.     fd = open (arname, O_RDWR, 0666);
  28.     if (fd < 0)
  29.       return -3;
  30. ***************
  31. *** 280,286 ****
  32. --- 288,298 ----
  33.     if (sizeof ar_hdr != write (fd, (char *) &ar_hdr, sizeof ar_hdr))
  34.       goto lose;
  35.     /* The file's mtime is the time we we want.  */
  36. + #ifdef GEMDOS
  37. +   stat(arname, &statbuf);
  38. + #else
  39.     fstat (fd, &statbuf);
  40. + #endif
  41.   #ifdef ARFMAG
  42.     /* Advance member's time to that time */
  43.     for (i = 0; i < sizeof ar_hdr.ar_date; i++)
  44. *** make-3.58/orig/commands.c    Mon Feb 12 19:43:02 1990
  45. --- make-3.58/commands.c    Mon Feb 12 19:23:34 1990
  46. ***************
  47. *** 342,347 ****
  48. --- 342,348 ----
  49.        int sig;
  50.   {
  51.     signal (sig, SIG_DFL);
  52. + #ifndef GEMDOS
  53.   #ifndef USG
  54.     (void) sigsetmask (0);
  55.   #endif
  56. ***************
  57. *** 387,392 ****
  58. --- 388,394 ----
  59.       wait_for_children (0, 1);
  60.   
  61.     /* Delete any non-precious intermediate files that were made.  */
  62. + #endif /* GEMDOS */
  63.   
  64.     remove_intermediates (1);
  65.   
  66. *** make-3.58/orig/dir.c    Wed Oct  4 01:12:46 1989
  67. --- make-3.58/dir.c    Mon Jan 29 22:47:32 1990
  68. ***************
  69. *** 36,41 ****
  70. --- 36,47 ----
  71.   #endif    /* USGr3 or DIRENT.  */
  72.   
  73.   
  74. + #ifdef GEMDOS
  75. + #define HASH_LIMIT 8    /* only consider this many characters of file names */
  76. + static short _limit = 0;
  77. + #endif
  78.   /* Hash table of directories.  */
  79.   
  80.   struct directory
  81. ***************
  82. *** 83,94 ****
  83. --- 89,108 ----
  84.     register char *p;
  85.     register struct directory *dir;
  86.   
  87. + #ifdef GEMDOS
  88. +   for (p = name, _limit = HASH_LIMIT; *p != '\0' && _limit-- > 0; ++p)
  89. + #else
  90.     for (p = name; *p != '\0'; ++p)
  91. + #endif
  92.       HASH (hash, *p);
  93.     hash %= DIRECTORY_BUCKETS;
  94.   
  95.     for (dir = directories[hash]; dir != 0; dir = dir->next)
  96. + #ifdef GEMDOS
  97. +     if (DOS_streq (dir->name, name))
  98. + #else
  99.       if (streq (dir->name, name))
  100. + #endif
  101.         break;
  102.   
  103.     if (dir == 0)
  104. ***************
  105. *** 151,157 ****
  106. --- 165,175 ----
  107.       /* Checking if the directory exists.  */
  108.       return 1;
  109.   
  110. + #ifdef GEMDOS
  111. +       for (p = filename,_limit = HASH_LIMIT; *p != '\0' && _limit-- > 0; ++p)
  112. + #else
  113.         for (p = filename; *p != '\0'; ++p)
  114. + #endif
  115.       HASH (hash, *p);
  116.         hash %= DIRFILE_BUCKETS;
  117.   
  118. ***************
  119. *** 158,164 ****
  120. --- 176,186 ----
  121.         /* Search the list of hashed files.  */
  122.   
  123.         for (df = dir->files[hash]; df != 0; df = df->next)
  124. + #ifdef GEMDOS
  125. +     if (DOS_streq (df->name, filename))
  126. + #else
  127.       if (streq (df->name, filename))
  128. + #endif
  129.         return !df->impossible;
  130.       }
  131.   
  132. ***************
  133. *** 174,180 ****
  134. --- 196,206 ----
  135.         /* Enter the file in the hash table.  */
  136.         register unsigned int newhash = 0;
  137.         register unsigned int i;
  138. + #ifdef GEMDOS
  139. +       for (i = 0, _limit = HASH_LIMIT; i < D_NAMLEN(d) && _limit-- > 0; ++i)
  140. + #else
  141.         for (i = 0; i < D_NAMLEN(d); ++i)
  142. + #endif
  143.       HASH (newhash, d->d_name[i]);
  144.         newhash %= DIRFILE_BUCKETS;
  145.         df = (struct dirfile *) xmalloc (sizeof (struct dirfile));
  146. ***************
  147. *** 184,191 ****
  148.         df->impossible = 0;
  149.   
  150.         /* Check if the name matches the one we're searching for.  */
  151. !       if (filename != 0
  152. !       && newhash == hash && streq (d->d_name, filename))
  153.       return 1;
  154.       }
  155.   
  156. --- 210,222 ----
  157.         df->impossible = 0;
  158.   
  159.         /* Check if the name matches the one we're searching for.  */
  160. !       if (filename != 0 && newhash == hash 
  161. ! #ifdef GEMDOS
  162. !       && DOS_streq (d->d_name, filename)
  163. ! #else
  164. !       && streq (d->d_name, filename)
  165. ! #endif
  166. !                     )
  167.       return 1;
  168.       }
  169.   
  170. ***************
  171. *** 251,257 ****
  172. --- 282,293 ----
  173.         filename = p = dirend + 1;
  174.       }
  175.   
  176. + #ifdef GEMDOS
  177. +   _limit = HASH_LIMIT;
  178. +   for (hash = 0; *p != '\0' && _limit-- > 0; ++p)
  179. + #else
  180.     for (hash = 0; *p != '\0'; ++p)
  181. + #endif
  182.       HASH (hash, *p);
  183.     hash %= DIRFILE_BUCKETS;
  184.   
  185. ***************
  186. *** 300,311 ****
  187. --- 336,356 ----
  188.       /* There are no files entered for this directory.  */
  189.       return 0;
  190.   
  191. + #ifdef GEMDOS
  192. +   _limit = HASH_LIMIT;
  193. +   for (hash = 0; *p != '\0' && _limit-- > 0; ++p)
  194. + #else
  195.     for (hash = 0; *p != '\0'; ++p)
  196. + #endif
  197.       HASH (hash, *p);
  198.     hash %= DIRFILE_BUCKETS;
  199.   
  200.     for (next = dir->files[hash]; next != 0; next = next->next)
  201. + #ifdef GEMDOS
  202. +     if (DOS_streq (filename, next->name))
  203. + #else
  204.       if (streq (filename, next->name))
  205. + #endif
  206.         return next->impossible;
  207.   
  208.     return 0;
  209. ***************
  210. *** 381,383 ****
  211. --- 426,469 ----
  212.       printf ("%u", impossible);
  213.     printf (" impossibilities in %u directories.\n", dirs);
  214.   }
  215. + #ifdef GEMDOS
  216. + /* checks to see if two names refer to the same file */
  217. + int DOS_streq(name1, name2)
  218. + char *name1, *name2;
  219. + {
  220. +     static char _name1[64], _name2[64];
  221. +     char *lastslash;
  222. +     extern char *rindex();
  223. +     int i;
  224. +     if (!strcmp(name1, name2)) return 1;
  225. +     unx2dos(name1, _name1);
  226. +     unx2dos(name2, _name2);
  227. +     name1 = rindex(_name1, '\\'); if (!name1) name1 = _name1;
  228. +     name2 = rindex(_name2, '\\'); if (!name2) name2 = _name2;
  229. +     for(i = 8; i>0; i--) {
  230. +         if (*name1 != *name2) return 0;
  231. +         if (*name1 == 0)
  232. +             return 1;
  233. +         if (*name1 == '.')
  234. +             goto doext;
  235. +         name1++; name2++;
  236. +     }
  237. + /* now look for extension */
  238. +     while (*name1 && *name1 != '.') name1++;
  239. +     while (*name2 && *name2 != '.') name2++;
  240. +     if (*name1 != *name2) return 0;
  241. + doext:
  242. +     name1++; name2++;
  243. +     for (i = 3; i > 0; i--) {
  244. +         if (*name1 != *name2) return 0;
  245. +         if (!*name1) return 1;
  246. +         name1++; name2++;
  247. +     }
  248. +     return 1;
  249. + }
  250. + #endif /* GEMDOS */
  251. *** make-3.58/orig/function.c    Mon Feb 12 19:43:06 1990
  252. --- make-3.58/function.c    Mon Feb 12 19:24:16 1990
  253. ***************
  254. *** 337,342 ****
  255. --- 337,345 ----
  256.       else
  257.         buf[0] = '\0';
  258.   
  259. + #ifdef GEMDOS
  260. +     perror_with_name (buf, "function not allowed under GEMDOS");
  261. + #else
  262.       if (pipe (pipedes) < 0)
  263.         {
  264.           perror_with_name (buf, "pipe");
  265. ***************
  266. *** 430,435 ****
  267. --- 433,439 ----
  268.           free (buffer);
  269.         }
  270.   
  271. + #endif /* GEMDOS */
  272.       free (text);
  273.       break;
  274.         }
  275. *** make-3.58/orig/job.c    Mon Feb 12 19:43:12 1990
  276. --- make-3.58/job.c    Tue Feb 13 18:50:50 1990
  277. ***************
  278. *** 23,28 ****
  279. --- 23,34 ----
  280.   #include "variable.h"
  281.   #include <errno.h>
  282.   
  283. + #ifdef GEMDOS
  284. + #include <ctype.h>
  285. + extern char *findfile();
  286. + static char *_extensions[] = { "ttp", "prg", "tos", 0 };
  287. + #endif
  288.   extern int errno;
  289.   
  290.   #if    defined(USG) && !defined(HAVE_VFORK)
  291. ***************
  292. *** 33,39 ****
  293.   #endif    /* USG and don't have vfork.  */
  294.   extern int vfork ();
  295.   
  296. ! #if    defined(HAVE_SYS_WAIT) || !defined(USG)
  297.   #include <sys/wait.h>
  298.   #include <sys/time.h>
  299.   #include <sys/resource.h>
  300. --- 39,45 ----
  301.   #endif    /* USG and don't have vfork.  */
  302.   extern int vfork ();
  303.   
  304. ! #if    (defined(HAVE_SYS_WAIT) || !defined(USG)) && !defined(GEMDOS)
  305.   #include <sys/wait.h>
  306.   #include <sys/time.h>
  307.   #include <sys/resource.h>
  308. ***************
  309. *** 62,67 ****
  310. --- 68,84 ----
  311.   
  312.   #else    /* WTERMSIG not defined and have <sys/wait.h> or not USG.  */
  313.   
  314. + # ifdef GEMDOS
  315. + #  define WAIT_T int
  316. + #  define WTERMSIG(x) 0
  317. + #  define WCOREDUMP(x) 0
  318. + #  define WEXITSTATUS(x)  x
  319. + #  define WIFSIGNALED(x) (WTERMSIG (x) != 0)
  320. + #  define WIFEXITED(x) (WTERMSIG (x) == 0)
  321. + # else
  322.   #define WAIT_T union wait
  323.   #define WTERMSIG(x) ((x).w_termsig)
  324.   #define WCOREDUMP(x) ((x).w_coredump)
  325. ***************
  326. *** 70,75 ****
  327. --- 87,94 ----
  328.   #define    WIFSIGNALED(x)    (WTERMSIG(x) != 0)
  329.   #endif
  330.   
  331. + #endif  /* GEMDOS */
  332.   #endif    /* WTERMSIG defined or USG and don't have <sys/wait.h>.  */
  333.   
  334.   
  335. ***************
  336. *** 153,159 ****
  337. --- 172,180 ----
  338.        Using the default action does the right thing.  */
  339.     (void) signal (SIGCLD, SIG_DFL);
  340.   #else
  341. + # ifndef GEMDOS
  342.     (void) sigblock (sigmask (SIGCHLD));
  343. + # endif
  344.   #endif
  345.   
  346.     block_remote_children ();
  347. ***************
  348. *** 166,172 ****
  349. --- 187,195 ----
  350.   #ifdef    USG
  351.     (void) signal (SIGCLD, child_handler);
  352.   #else
  353. + # ifndef GEMDOS
  354.     (void) sigsetmask (sigblock (0) & ~sigmask (SIGCHLD));
  355. + # endif
  356.   #endif
  357.   
  358.     unblock_remote_children ();
  359. ***************
  360. *** 209,215 ****
  361.       {
  362.         /* No remote children.  Check for local children.  */
  363.   
  364. ! #if    !defined(USG) || defined(HAVE_SYS_WAIT)
  365.         if (sig > 0)
  366.           pid = wait3 (&status, WNOHANG, (struct rusage *) 0);
  367.         else
  368. --- 232,238 ----
  369.       {
  370.         /* No remote children.  Check for local children.  */
  371.   
  372. ! #if    (!defined(USG) || defined(HAVE_SYS_WAIT)) && !defined(GEMDOS)
  373.         if (sig > 0)
  374.           pid = wait3 (&status, WNOHANG, (struct rusage *) 0);
  375.         else
  376. ***************
  377. *** 238,243 ****
  378. --- 261,267 ----
  379.       /* We got a remote child.  */
  380.       remote = 1;
  381.   
  382. + #ifndef GEMDOS
  383.         /* Check if this is the child of the `shell' function.  */
  384.         if (!remote && pid == shell_function_pid)
  385.       {
  386. ***************
  387. *** 259,264 ****
  388. --- 283,290 ----
  389.           continue;
  390.       }
  391.   
  392. + #endif /* GEMDOS */
  393.         child_failed = exit_sig != 0 || exit_code != 0;
  394.   
  395.         /* Search for a child matching the deceased one.  */
  396. ***************
  397. *** 536,541 ****
  398. --- 562,568 ----
  399.     
  400.     /* Set up a bad standard input that reads from a broken pipe.  */
  401.   
  402. + #ifndef GEMDOS
  403.     if (bad_stdin == -1)
  404.       {
  405.         /* Make a file descriptor that is the read end of a broken pipe.
  406. ***************
  407. *** 549,554 ****
  408. --- 576,582 ----
  409.         bad_stdin = pd[0];
  410.       }
  411.       }
  412. + #endif /* GEMDOS */
  413.   
  414.     /* Decide whether to give this child the `good' standard input
  415.        (one that points to the terminal or whatever), or the `bad' one
  416. ***************
  417. *** 695,700 ****
  418. --- 723,729 ----
  419.     if (stdout_fd != 1)
  420.       (void) dup2 (stdout_fd, 1);
  421.   
  422. + #ifndef GEMDOS
  423.     /* Free up file descriptors.  */
  424.     {
  425.       register int d;
  426. ***************
  427. *** 702,707 ****
  428. --- 731,737 ----
  429.       for (d = 3; d < max; ++d)
  430.         (void) close (d);
  431.     }
  432. + #endif
  433.   
  434.     /* Don't block children for our child.  */
  435.     unblock_children ();
  436. ***************
  437. *** 719,724 ****
  438. --- 749,757 ----
  439.   search_path (file, path)
  440.        char *file, *path;
  441.   {
  442. + #ifdef GEMDOS
  443. +   return findfile(file, path, _extensions);
  444. + #else
  445.     if (*path == '\0' || index (file, '/') != 0)
  446.       return file;
  447.     else
  448. ***************
  449. *** 785,790 ****
  450. --- 818,824 ----
  451.       }
  452.   
  453.     return 0;
  454. + #endif /* GEMDOS */
  455.   }
  456.   
  457.   /* Replace the current process with one running the command in ARGV,
  458. ***************
  459. *** 855,861 ****
  460. --- 889,899 ----
  461.        char *line;
  462.        struct file *file;
  463.   {
  464. + #ifdef GEMDOS
  465. +   static char sh_chars[] = "#;\"*?[]&|<>(){}$`";
  466. + #else
  467.     static char sh_chars[] = "#;\"*?[]&|<>(){}=$`";
  468. + #endif
  469.     static char *sh_cmds[] = { "cd", "eval", "exec", "exit", "login",
  470.                    "logout", "set", "umask", "wait", "while", "for",
  471.                    "case", "if", ":", ".", "break", "continue",
  472. ***************
  473. *** 868,873 ****
  474. --- 906,912 ----
  475.     int instring;
  476.     char **new_argv = 0;
  477.   
  478. + #ifndef GEMDOS
  479.     /* See if it is safe to parse commands internally.  */
  480.     p = variable_expand_for_file ("$(SHELL)", file);
  481.     if (strcmp (p, "/bin/sh"))
  482. ***************
  483. *** 876,881 ****
  484. --- 915,921 ----
  485.     for (ap = p; *ap != '\0'; ++ap)
  486.       if (*ap != ' ' && *ap != '\t' && *ap != '\n')
  487.         goto slow;
  488. + #endif /* GEMDOS */
  489.   
  490.     i = strlen (line) + 1;
  491.   
  492. ***************
  493. *** 911,916 ****
  494. --- 951,962 ----
  495.         {
  496.         case '\\':
  497.           if (p[1] != '\0' && p[1] != '\n')
  498. + #ifdef GEMDOS
  499. +     /* in case we're in a file name -- this is a kludge! */
  500. +         if (isalnum(p[1]) || p[1] == '.')
  501. +         *ap++ = *p;
  502. +         else
  503. + #endif
  504.             /* Copy and skip the following char.  */
  505.             *ap++ = *++p;
  506.           break;
  507. ***************
  508. *** 1144,1146 ****
  509. --- 1190,1204 ----
  510.     return fd;
  511.   }
  512.   #endif    /* USG and not USGr3 and not HAVE_DUP2.  */
  513. + #ifdef GEMDOS
  514. + int execve(name, argv, envp)
  515. + char *name, **argv, **envp;
  516. + {
  517. +     int r;
  518. +     r = spawnve(0, name, argv, envp);
  519. +     if (r < 0) return r;
  520. +     _exit(r);
  521. + }
  522. + #endif
  523. *** make-3.58/orig/main.c    Mon Feb 12 19:43:24 1990
  524. --- make-3.58/main.c    Mon Feb 12 19:25:18 1990
  525. ***************
  526. *** 24,29 ****
  527. --- 24,32 ----
  528.   #include <ctype.h>
  529.   #include <time.h>
  530.   
  531. + #ifdef GEMDOS
  532. + long _stksize = 20*1024L;
  533. + #endif
  534.   
  535.   extern char *version_string;
  536.   
  537. ***************
  538. *** 283,289 ****
  539. --- 286,298 ----
  540.     register struct dep *lastgoal;
  541.     struct dep *read_makefiles;
  542.     char current_directory[MAXPATHLEN];
  543. + #if defined(GEMDOS) && defined(__GNUC__)
  544. +   extern int _unixmode;
  545. +   extern int _mallocChunkSize();
  546.   
  547. +   _unixmode = 3;        /* full Unix filename translation */
  548. +   _mallocChunkSize(16*1024L);    /* minimum asked for from system  */
  549. + #endif
  550.     default_goal_file = 0;
  551.     reading_filename = 0;
  552.     reading_lineno_ptr = 0;
  553. ***************
  554. *** 345,358 ****
  555.   
  556.     /* Figure out where this program lives.  */
  557.   
  558. !   if (argv[0] == 0)
  559. !     argv[0] = "";
  560. !   if (argv[0][0] == '\0')
  561.       program = "make";
  562.     else 
  563.       {
  564.         program = rindex (argv[0], '/');
  565.         if (program == 0)
  566.       program = argv[0];
  567.         else
  568.       ++program;
  569. --- 354,369 ----
  570.   
  571.     /* Figure out where this program lives.  */
  572.   
  573. !   if (argv[0] == 0 || argv[0][0] == '\0')
  574.       program = "make";
  575.     else 
  576.       {
  577.         program = rindex (argv[0], '/');
  578.         if (program == 0)
  579. + #ifdef GEMDOS
  580. +     program = rindex(argv[0], '\\');
  581. +       if (program == 0)
  582. + #endif
  583.       program = argv[0];
  584.         else
  585.       ++program;
  586. ***************
  587. *** 565,571 ****
  588. --- 576,584 ----
  589.   #ifdef SIGCHLD
  590.     (void) signal (SIGCHLD, child_handler);
  591.   #else
  592. + # ifdef SIGCLD
  593.     (void) signal (SIGCLD, child_handler);
  594. + # endif
  595.   #endif
  596.   
  597.     /* Install the default implicit rules.  */
  598. *** make-3.58/orig/make.h    Sun Sep 17 19:35:56 1989
  599. --- make-3.58/make.h    Mon Feb 12 20:24:32 1990
  600. ***************
  601. *** 18,23 ****
  602. --- 18,27 ----
  603.   #include <signal.h>
  604.   #include <stdio.h>
  605.   
  606. + #ifdef GEMDOS
  607. + #define DIRENT
  608. + #endif
  609.   #ifndef    sun
  610.   #include <sys/types.h>
  611.   #endif
  612. ***************
  613. *** 67,74 ****
  614. --- 71,83 ----
  615.   #endif
  616.   
  617.   /* Add to VAR the hashing value of C, one character in a name.  */
  618. + #ifdef GEMDOS
  619. + #define HASH(var, c) \
  620. +   ((var += toupper(c)), (var = ((var) << 7) + ((var) >> 20)))
  621. + #else
  622.   #define    HASH(var, c) \
  623.     ((var += (c)), (var = ((var) << 7) + ((var) >> 20)))
  624. + #endif
  625.   
  626.   #if defined(__GNUC__) || defined(ENUM_BITFIELDS)
  627.   #define    ENUM_BITFIELD(bits)    :bits
  628. ***************
  629. *** 116,122 ****
  630.   extern int glob_pattern_p ();
  631.   extern char **glob_filename ();
  632.   
  633. ! #ifndef    USG
  634.   extern int sigsetmask ();
  635.   #endif
  636.   extern int kill (), sigblock ();
  637. --- 125,131 ----
  638.   extern int glob_pattern_p ();
  639.   extern char **glob_filename ();
  640.   
  641. ! #if !defined(USG) && !defined(GEMDOS)
  642.   extern int sigsetmask ();
  643.   #endif
  644.   extern int kill (), sigblock ();
  645. *** make-3.58/orig/makefile    Mon Feb 12 19:42:58 1990
  646. --- make-3.58/makefile    Tue Feb 13 21:14:26 1990
  647. ***************
  648. *** 18,27 ****
  649.   #
  650.   #    Makefile for GNU Make
  651.   #
  652.   
  653. - CFLAGS = $(defines) -g
  654. - LDFLAGS = -g
  655.   # Define nothing for BSD, USG for System V, and USGr3 (as well as USG) for
  656.   # SVR3, HPUX for HP-UX (as well as USG or USGr3 as appropriate).  If you have a
  657.   # USG hybrid with <sys/wait.h> and wait3, define HAVE_SYS_WAIT.  If you are USG
  658. --- 18,28 ----
  659.   #
  660.   #    Makefile for GNU Make
  661.   #
  662. + # Note: Atari ST users may as well omit the -g, since the Atari gdb doesn't
  663. + # support it.
  664. + CFLAGS = $(defines) -O -fomit-frame-pointer
  665. + LDFLAGS =
  666.   
  667.   # Define nothing for BSD, USG for System V, and USGr3 (as well as USG) for
  668.   # SVR3, HPUX for HP-UX (as well as USG or USGr3 as appropriate).  If you have a
  669.   # USG hybrid with <sys/wait.h> and wait3, define HAVE_SYS_WAIT.  If you are USG
  670. ***************
  671. *** 31,38 ****
  672.   # NO_MINUS_C_MINUS_O.  If you don't want archive support, define NO_ARCHIVES.
  673.   # If you want to avoid use of floating-point numbers, define NO_FLOAT.  If your
  674.   # compiler can handle `enum' bitfields (and it's not GCC), define
  675. ! # ENUM_BITFIELDS.
  676. ! defines =
  677.   
  678.   # Define UMAX here to use Encore's inq_stats call.  Define UMAX_43 (and UMAX)
  679.   # if you have UMAX 4.3 instead of UMAX 4.2.  If the load average is in a symbol
  680. --- 32,39 ----
  681.   # NO_MINUS_C_MINUS_O.  If you don't want archive support, define NO_ARCHIVES.
  682.   # If you want to avoid use of floating-point numbers, define NO_FLOAT.  If your
  683.   # compiler can handle `enum' bitfields (and it's not GCC), define
  684. ! # ENUM_BITFIELDS. For the Atari ST and TOS, define GEMDOS.
  685. ! defines = -DGEMDOS
  686.   
  687.   # Define UMAX here to use Encore's inq_stats call.  Define UMAX_43 (and UMAX)
  688.   # if you have UMAX 4.3 instead of UMAX 4.2.  If the load average is in a symbol
  689. ***************
  690. *** 42,49 ****
  691.   # "(double) load".  If a `struct nlist' (as defined in <nlist.h>) has a `n_un'
  692.   # union, rather than a simple `n_name' member, define NLIST_NAME_UNION.  If the
  693.   # `n_name' member of a `struct nlist' is an array that must be copied into,
  694. ! # define NLIST_NAME_ARRAY.  Otherwise, define NO_LDAV.
  695. ! LOAD_AVG =
  696.   
  697.   # If you don't want archive support, comment these out.
  698.   ARCHIVES = arscan.o ar.o
  699. --- 43,50 ----
  700.   # "(double) load".  If a `struct nlist' (as defined in <nlist.h>) has a `n_un'
  701.   # union, rather than a simple `n_name' member, define NLIST_NAME_UNION.  If the
  702.   # `n_name' member of a `struct nlist' is an array that must be copied into,
  703. ! # define NLIST_NAME_ARRAY.  Otherwise (e.g. GEMDOS), define NO_LDAV.
  704. ! LOAD_AVG = -DNO_LDAV
  705.   
  706.   # If you don't want archive support, comment these out.
  707.   ARCHIVES = arscan.o ar.o
  708. *** make-3.58/orig/misc.c    Tue Jul 11 07:45:52 1989
  709. --- make-3.58/misc.c    Sun Jan 28 22:30:50 1990
  710. ***************
  711. *** 240,246 ****
  712. --- 240,250 ----
  713.     extern int errno, sys_nerr;
  714.     extern char *sys_errlist[];
  715.   
  716. + #ifdef GEMDOS
  717. +   if (errno <= 0 && errno >= sys_nerr)
  718. + #else
  719.     if (errno < sys_nerr)
  720. + #endif
  721.       error ("%s%s: %s", str, name, sys_errlist[errno]);
  722.     else
  723.       error ("%s%s: Unknown error %d", str, name, errno);
  724. *** make-3.58/orig/read.c    Mon Feb 12 19:43:34 1990
  725. --- make-3.58/read.c    Mon Feb 12 19:26:44 1990
  726. ***************
  727. *** 72,80 ****
  728. --- 72,85 ----
  729.   
  730.   static char *default_include_directories[] =
  731.     {
  732. + #ifdef GEMDOS
  733. +     "/gnu/include",
  734. +     "/gnu/lib",
  735. + #else
  736.       "/usr/gnu/include",
  737.       "/usr/local/include",
  738.       "/usr/include",
  739. + #endif
  740.       0
  741.     };
  742.   
  743. ***************
  744. *** 1354,1359 ****
  745. --- 1359,1369 ----
  746.     register char **dirs = (char **) xmalloc ((5 + defsize) * sizeof (char *));
  747.     register unsigned int idx = 0;
  748.   
  749. + #ifdef GEMDOS
  750. +   char *env_dir;
  751. +   extern char *getenv();
  752. + #endif
  753.     /* First consider any dirs specified with -I switches.
  754.        Ignore dirs that don't exist.  */
  755.   
  756. ***************
  757. *** 1373,1378 ****
  758. --- 1383,1396 ----
  759.         }
  760.         }
  761.   
  762. + #ifdef GEMDOS
  763. +   /* Check environment for where include directories are */
  764. +   if (env_dir = getenv("GNUINC"))
  765. +     default_include_directories[0] = env_dir;
  766. +   if (env_dir = getenv("GNULIB"))
  767. +     default_include_directories[1] = env_dir;
  768. + #endif
  769.     /* Now add at the end the standard default dirs.  */
  770.   
  771.     for (i = 0; default_include_directories[i] != 0; ++i)
  772. ***************
  773. *** 1389,1395 ****
  774. --- 1407,1417 ----
  775.       {
  776.         unsigned int len = strlen (dirs[i]);
  777.         /* If dir name is written with a trailing slash, discard it.  */
  778. + #ifdef GEMDOS
  779. +       if (dirs[i][len - 1] == '/' || dirs[i][len - 1] == '\\')
  780. + #else
  781.         if (dirs[i][len - 1] == '/')
  782. + #endif
  783.       /* We can't just clobber a null in because it may have come from
  784.          a literal string and literal strings may not be writable.  */
  785.       dirs[i] = savestring (dirs[i], len - 1);
  786. *** make-3.58/orig/remake.c    Mon Feb 12 19:43:44 1990
  787. --- make-3.58/remake.c    Fri Feb 16 11:52:04 1990
  788. ***************
  789. *** 624,629 ****
  790. --- 624,634 ----
  791.         if (fd < 0)
  792.       TOUCH_ERROR ("touch: open: ");
  793.         else
  794. + #ifdef GEMDOS
  795. +       (void) close(fd);
  796. +       if (utime(file->name, 0L))
  797. +         TOUCH_ERROR("touch: utime: ");
  798. + #else
  799.       {
  800.         struct stat statbuf;
  801.         char buf;
  802. ***************
  803. *** 648,653 ****
  804. --- 653,659 ----
  805.           }
  806.         (void) close (fd);
  807.       }
  808. + #endif /* GEMDOS */
  809.       }
  810.   
  811.     return 0;
  812. ***************
  813. *** 781,791 ****
  814. --- 787,812 ----
  815.   {
  816.     time_t mtime;
  817.     char *name;
  818. + #ifdef GEMDOS
  819. +   char *libpath;
  820. +   extern char *getenv();
  821.   
  822. +   if (!(libpath = getenv("GNULIB")))
  823. +     libpath = "/gnu/lib";
  824. +   libpath = concat(libpath, "/", "");
  825. +   name = concat(libpath, lib, ".olb");    /* TOS GCC uses .olb for library files */
  826. +   free(libpath);
  827. + #else
  828.     name = concat ("/usr/lib/lib", lib, ".a");
  829. + #endif /* GEMDOS */
  830.     mtime = name_mtime (name);
  831.     if (mtime == (time_t) -1)
  832. + #ifdef GEMDOS
  833. +     mtime = name_mtime (rindex(name, '/'));
  834. + #else
  835.       mtime = name_mtime (name + 4);
  836. + #endif
  837.     if (mtime == (time_t) -1)
  838.       {
  839.         char *local = concat ("/usr/local/lib/lib", lib,  ".a");
  840. *** make-3.58/orig/variable.c    Mon Feb 12 19:43:54 1990
  841. --- make-3.58/variable.c    Mon Feb 12 19:27:40 1990
  842. ***************
  843. *** 366,371 ****
  844. --- 366,372 ----
  845.        will provide one if there isn't one there.  */
  846.     v = define_variable ("SHELL", 5, "/bin/sh", o_default, 0);
  847.   
  848. + #ifndef GEMDOS
  849.     /* Don't let SHELL come from the environment
  850.        if MAKELEVEL is 0.  Also, SHELL must not be empty.  */
  851.     if (*v->value == '\0' || (v->origin == o_env && makelevel == 0))
  852. ***************
  853. *** 373,378 ****
  854. --- 374,380 ----
  855.         v->origin = o_file;
  856.         v->value = savestring ("/bin/sh", 7);
  857.       }
  858. + #endif
  859.   }
  860.   
  861.   /* Subroutine of variable_expand and friends:
  862.